const files = require.context(".", true, /\.ts$/);
let modules: any = {};

files.keys().forEach(key => {
  if (key === "./index.ts") {
    return;
  }
  const moduleName = key.split("/")[1].split(".")[0];
  modules[moduleName] = files(key).default;
});

export default modules;
